<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 求100以内偶数的和 -->
    <script>
        let num = 0
        for (let i = 1; i <= 100; i++) {
            // 筛选偶数
            if (i % 2 !== 0) {

            }
            //  和用num接收 
            else { num = num + i }

        }
        document.write(`偶数和为${num}`)
    </script>
</body>

</html>